import socket

address = ('192.168.1.67', 514)
#address = ('127.0.0.1', 514)

#s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#ble
#msg = '<14>Sep 18 15:47:18.257511 hh-desktop main.py: {"bleinfo": {"hops": 2, "asset_mac": "88:11:96:4D:3B:D9", "Flags": "04", "detail": "Honor Watch-BD9", "interface": "Ble", "asset_ip": "88:11:96:4D:3B:D9", "services": {"9": {"Service(UUID)": "uuid=Generic Access handleStart=1 handleEnd=9", "ch_type": "READ ", "character": "2ac9"}, "3": {"Service(UUID)": "uuid=Generic Access handleStart=1 handleEnd=9", "ch_type": "READ ", "character": "Device Name"}, "12": {"Service(UUID)": "uuid=Generic Attribute handleStart=10 handleEnd=13", "ch_type": "INDICATE ", "character": "Service Changed"}, "5": {"Service(UUID)": "uuid=Generic Access handleStart=1 handleEnd=9", "ch_type": "READ ", "character": "Appearance"}, "7": {"Service(UUID)": "uuid=Generic Access handleStart=1 handleEnd=9", "ch_type": "READ ", "character": "Central Address Resolution"}}, "rssi": -74, "asset_type": "public"}} '
#blue
#msg = '<14>Nov 12 19:23:55.245277 hh-desktop main.py: {"status": "on", "hops": 2, "asset_mac": "20:47:DA:C4:A5:6D", "pro": "unknown", "detail": "MI 6", "ports": "unknown", "asset_ip": "20:47:DA:C4:A5:6D", "interface": "Classic Blue", "model": "", "asset_type": "Aphone", "protocols": "unknown"}'
#blueattack
#msg ='{"attack_type": {"120": "attack type:scan or fuzz", "6": "attack type:scan or fuzz"}, "count": [6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102, 108, 114, 120], "time": "2019-08-28 16:58:22", "MAC": "48:2C:A0:0F:1F:AD"}'
#msg = 'short_and_ieee:3286-00124B001D1A980F%'
#wifiList
#msg ="5361 INFO: <14>Sep 02 17:47:50.344636 secsmarts-desktop realscan.py: {'apList': {'44:6e:e5:7f:fe:a5': ['HUAWEI-B310-FEA5', 5, ['WPA2', 'WPA'], -59, -66, -49, 44, 18], '06:5f:a7:76:75:d8': ['JCG-6675D8-2.4G', 6, ['WPA', 'WPA2'], -56, -68, -42, 6, 18], '04:5f:a7:5a:b5:f0': ['TY6', 6, ['WPA', 'WPA2'], -65, -80, -65, 0, 18], 'e4:f3:f5:65:f8:8a': ['MERCURY_F88A', 13, ['WPA', 'WPA2'], -66, -70, -60, 159, 18], '14:9d:09:a4:eb:78': ['leyard', 6, ['WPA2', 'WPA'], -63, -66, -43, 17, 18]}} "
# not_A_assocition
#msg ="5361 INFO: <14>Sep 02 17:47:50.356786 secsmarts-desktop realscan.py: {'notAssociatedStation': ['10:fa:ce:c5:23:94', '78:0f:77:06:41:4d', '78:0f:77:28:98:51', 'f8:a4:5f:51:b4:f1', '16:35:9f:19:53:fc', '18:1d:ea:a0:6d:d8', '4c:74:bf:5a:4e:23', '58:94:6b:24:68:9c', 'da:a1:19:11:dc:87', '58:00:e3:f8:10:09']}"
# A_assocition
#msg = '{"associatedStation": [["78:7e:61:94:a8:83", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["10:08:b1:f6:ed:69", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["33:33:00:00:00:fb", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["3c:cd:5d:e8:4e:59", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["74:60:fa:fe:75:e6", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["33:33:ff:22:05:ac", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["00:15:00:65:9c:c0", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["ac:bc:32:98:c9:13", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["10:b1:f8:0a:c2:de", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["33:33:00:01:00:03", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["5c:c3:07:f2:bc:2e", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["01:00:5e:00:00:16", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["04:54:53:0e:df:91", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["d0:d7:83:94:e1:20", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["ac:bc:32:a5:02:53", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["33:33:00:00:00:02", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["bc:30:7e:09:07:2f", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["18:1d:ea:a0:6d:d8", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["01:00:5e:00:00:fb", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["01:00:5e:00:00:fc", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["33:33:00:00:00:16", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["4c:74:bf:5a:4e:23", ["06:5f:a7:76:75:d8",' \
   #   ' "JCG-6675D8-2.4G"]], ["33:33:00:00:00:0c", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["80:ad:16:d1:4e:2b", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["78:02:f8:22:05:ac", ["06:5f:a7:76:75:d8", "JCG-6675D8-2.4G"]], ["01:00:5e:7f:ff:fa", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["01:00:5e:00:00:02", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["ff:ff:ff:ff:ff:ff", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["f0:c9:d1:84:f7:c5", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["30:95:e3:11:8d:e6", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["30:ff:f6:2f:8d:b3", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["33:33:00:01:00:02", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["64:eb:8c:7f:30:58", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]], ["10:fa:ce:c5:23:94", ["f0:b4:29:6f:36:31", "zhinenghuanjing"]]]}'
# probSsid
#msg = "5361 INFO: <14>Sep 02 17:47:50.357660 secsmarts-desktop realscan.py: {'probSsid': ['OPPO Find X', 'JCG-6675D8-2.4G', 'slab', 'MERCURY_F88A']}"
# bleattack
#msg = '{"bleFuzzScan": {"time": "2019-09-04 16:37:47", "master": "00:1a:7d:da:71:13", "attack_type": "bleFuzzAttack", "slave": "f5:26:9d:21:a7:fe"} }'
# wifidoss
#msg = '{"dosAttack": {"type": "disassociationAttack", "victim": "06:5f:a7:76:75:d8"}}'
#msg = '{"dosAttack": {"type": "proberequAttack", "victim": "Tenda_F88"}}'
#msg='{"probSsid": [{"CLIENT": "bc:30:7e:09:07:2f", "SSID": "MERCURY_F88A"}, {"CLIENT": "78:0f:77:28:98:51", "SSID": "OPPO Find X"}]}'
#msg = '{"fakeAp": ["TBD_wifi", "mac not in whitelist"]}'
# wifi leak
msg ='routerleak:dlink-403C;192.168.0.1 80 http exploits/routers/dlink/dir_850l_creds_disclosure;192.168.0.1 80 http exploits/routers/dlink/multi_hnap_rce;192.168.0.1 80 http exploits/routers/dlink/dir_8xx_password_disclosure;192.168.0.1 1900 custom/udp exploits/routers/dlink/dir_300_645_815_upnp_rce'
# blueleak
#msg ='<14>Nov 19 12:47:01.062635 hh-desktop main.py: {"blueleak": [["22:22:82:8E:CA:64", "CVE-2017-0785"], ["22:22:82:8E:CA:64", "CVE-2017-13258"]]}'
# wifileak
#msg ='<14>Nov 20 20:25:14.763324 hh-desktop main.py: {"wifileak": ["94:ba:56:00:cb:ba", "CVE-2019-3846"]}'
# ss
#msg = '<14>Nov 22 10:03:43.017848 hh-desktop tools_huey_probe: {"blueleak": [["22:22:82:8E:CA:64", "CVE-2017-0782"]]}'
msg ='{"associatedStation": {"HUAWEI-B310-FEA5;44:6e:e5:7f:fe:a5": ["d0:ba:e4:14:00:e8"], "zhinenghuanjing;f0:b4:29:6f:36:31": ["30:ff:f6:2f:8d:b3", "01:00:5e:00:00:02", "10:fa:ce:c5:23:94", "3c:42:7e:0d:0c:16", "01:00:5e:7f:ff:fa", "33:33:ff:21:7b:c3", "78:0f:77:28:98:50", "33:33:ff:6b:33:dc", "33:33:ff:ba:9b:2e", "33:33:ff:ca:7a:a9", "10:d0:7a:f5:b5:9e", "01:80:c2:00:00:00", "33:33:ff:c5:c4:b5", "33:33:ff:d2:33:3f", "33:33:00:00:00:02", "33:33:00:00:00:01", "33:33:ff:1c:6e:d6", "33:33:ff:4e:b2:6e", "33:33:00:00:01:40", "33:33:ff:ce:07:c1", "34:13:e8:63:f6:eb", "33:33:ff:4e:ec:73", "33:33:ff:a3:b8:53", "33:33:ff:8b:3a:ce", "33:33:ff:60:dd:b9", "33:33:ff:00:05:89", "33:33:ff:00:00:00", "33:33:ff:6c:87:5d", "30:95:e3:11:8d:e6", "33:33:ff:79:08:0c", "01:00:5e:00:00:fb", "78:0f:77:06:41:4d", "33:33:ff:90:26:72", "33:33:ff:11:5e:e0", "33:33:ff:46:9d:c9", "04:cf:8c:91:35:3f", "74:60:fa:fe:75:e6", "33:33:ff:66:60:7c", "33:33:ff:c5:23:94", "33:33:ff:3f:59:7e", "33:33:ff:dd:df:51", "33:33:ff:de:61:59", "33:33:ff:34:95:1f", "3c:a0:67:29:11:b6", "78:11:dc:b6:5b:ca", "f0:c9:d1:84:f7:c5", "64:eb:8c:7f:30:58", "78:da:07:7a:9e:99", "04:fa:83:86:01:8f", "33:33:ff:00:00:01", "33:33:00:01:00:02"], "Tenda_F88;c8:3a:35:23:46:b8": ["58:e6:ba:6b:82:11", "54:ea:a8:85:2d:5f", "4c:74:bf:5a:4e:23", "00:26:66:47:9e:a4"], "JCG-6675D8-2.4G;06:5f:a7:76:75:d8": ["33:33:00:00:00:fb", "dc:a6:32:25:ed:5e", "ac:bc:32:a4:d2:6f", "a4:83:e7:7b:4e:5b", "70:f1:1c:20:82:c2", "54:2b:8d:d1:b0:94", "04:54:53:0e:df:91", "bc:30:7e:09:07:2f", "01:00:5e:00:00:fb", "cc:66:0a:d6:59:1a", "c8:3a:35:23:46:b8", "ac:bc:32:a4:d2:97", "d8:9c:67:15:b5:27", "10:41:7f:d6:84:ce", "48:e9:f1:ca:88:e7", "ac:bc:32:98:c9:13", "10:b1:f8:0a:c2:de", "d0:d7:83:94:e1:20", "33:33:00:00:00:16"], "kjtest-2.4G;06:5f:a7:76:79:04": ["a4:83:e7:7b:09:b5", "88:64:40:51:e0:eb", "e4:46:da:fe:b6:d9", "6c:88:14:33:10:cc"], "slab;bc:ee:7b:6f:fc:a8": ["01:80:c2:00:00:00", "34:08:bc:eb:94:c7", "7c:c3:a1:b6:db:99", "90:f0:52:5b:10:4f", "6c:56:97:90:28:a0", "01:00:5e:7f:ff:fa", "e8:b1:fc:32:4f:3d", "d8:9b:3b:74:2d:92", "01:00:5e:00:00:fb", "01:00:5e:00:00:fc", "cc:2d:b7:f1:a4:00", "33:33:00:00:00:fb", "ac:16:2d:21:68:44", "80:a5:89:85:d6:b1", "20:c9:d0:7a:1b:1f"], "HUAWEI-B310-FE82;44:6e:e5:7f:fe:82": ["d0:ba:e4:13:f9:d6"], "N5 3F wifi;9a:d9:b3:7c:2b:87": ["d4:67:d3:6c:12:8b"]}}'
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(msg, address)
s.close()
'''
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)s
s.connect(address)
while True:
    d = s.recv(1024)
    print d
    #s.send("hello from client")
s.close()
'''